import {
  RECEIVE_LEAVEWORLD,
  RECEIVE_BLOGS,
  RECEIVE_MUSIC,
  RECEIVE_BLOG_DETAILS,
  RECEIVE_CASES,
  RECEIVE_USER,
  RECEIVE_INTRODUCE,
  RECEIVE_SINGLE_INTRODUCE,
  RECEIVE_SEARCH_BLOGS
} from "./mutation-types"

export default {
  [RECEIVE_LEAVEWORLD](state, {leaveWorld}) {
    state.leaveWorld = leaveWorld
  },
  [RECEIVE_BLOGS](state, {blogs}) {
    state.blogs = blogs
  },
  [RECEIVE_MUSIC](state, {music}) {
    state.music = music
  },
  [RECEIVE_BLOG_DETAILS](state, blogDetails) {
    state.blogDetails = blogDetails
  },
  [RECEIVE_CASES](state, cases) {
    state.cases = cases
  },
  [RECEIVE_USER](state, user) {
    window.sessionStorage.setItem('username',user.username)
  },
  [RECEIVE_INTRODUCE](state, introduce) {
    state.introduce = introduce
  },
  [RECEIVE_SINGLE_INTRODUCE](state, singleIntroduce) {
    state.singleIntroduce = singleIntroduce
  },
  [RECEIVE_SEARCH_BLOGS](state, blogs) {
    state.blogs = blogs
  },
}